<!-- +----------------------------------------------------------------------
| 麦沃德科技赋能开发者，助力中小企业发展 
+----------------------------------------------------------------------
| Copyright (c) 2017～2024  www.wdadmin.cn    All rights reserved.
+----------------------------------------------------------------------
| 沃德代驾系统并不是自由软件，不加密，并不代表开源，未经许可不可自由转售和商用
+----------------------------------------------------------------------
| Author: MY WORLD Team <bd@maiwd.cn>   www.wdadmin.cn
+----------------------------------------------------------------------
| 组件-订单菜单 开发者: 麦沃德科技-半夏
+---------------------------------------------------------------------- -->

<template>
	<view class="component-menu-order">
		<view class="order-cloumn" :style="{width: boxWidth}" v-for="(item, index) in showData" :key="index">
			<view class="cloumn-item" @click="toPage(item.info)">
				<view class="item-icon" :style="{width: iconWidth, height: iconWidth}">
					<view class="icon" :style="{backgroundImage: 'url('+ item.icon +')', backgroundSize: iconWidth}" v-if="item.icon"></view>
				</view>
				<view class="item-text" :style="{fontSize: fontSize}">{{item.text}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "componentMenuOrder",
		props: {
			showData: {
				type: Array,
				default () {
					return []
				}
			},
			boxWidth: {
				type: String,
				default: "25%"
			},
			iconWidth: {
				type: String,
				default: "64rpx"
			},
			fontSize: {
				type: String,
				default: "28rpx"
			},
		},
		methods: {
			// 跳转页面
			toPage(e) {
				this.$util.toPage(e)
			}
		},
	}
</script>

<style lang="scss">
	.component-menu-order {
		width: 100%;
		display: flex;

		.order-cloumn {
			width: 25%;

			.cloumn-item {
				margin: 0 auto;
				position: relative;

				.item-icon {
					margin: 0 auto;

					.icon {
						width: 100%;
						height: 100%;
					}
				}

				.item-text {
					text-align: center;
					line-height: 1.4;
					font-weight: 600;
					margin-top: 12rpx;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					word-break: break-all;
					color: #242629;
				}
			}
		}
	}
</style>